package cn.spiral.qz_job.jobclass;

import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.scheduling.quartz.QuartzJobBean;

import cn.spiral.qz_job.service.QzJobService;
import cn.spiral.qz_job.service.impl.QzJobServiceImpl;

public class test extends QuartzJobBean{

	@Override
	protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException {
		
		JobDataMap jobDataMap=jobExecutionContext.getJobDetail().getJobDataMap();
		String jobName=jobDataMap.getString("jobName");
		QzJobServiceImpl qzJobService=(QzJobServiceImpl) jobDataMap.get("qzJobService");
		qzJobService.findJobByName(jobName);
	}

	public static void main(String[] args) {
		
		ApplicationContext context=new ClassPathXmlApplicationContext("applicationContext.xml");
		QzJobService qzJobService=(QzJobService) context.getBean("qzJobService");
		//qzJobService.test();
		
	}
	
}
